<?php

namespace app\admin\model;

use think\Model;

/**
 * Withdrawal
 */
class Withdrawal extends Model
{
    // 表名
    protected $name = 'withdrawal';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = true;
    protected $createTime = 'timestamp'; // 自定义创建时间字段名

    // 字段类型转换
    protected $type = [
        'timestamp'   => 'timestamp:Y-m-d H:i:s',
        'handle_time' => 'timestamp:Y-m-d H:i:s',
    ];

    public function user(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\User::class, 'uid', 'id');
    }

}